<template>
    <el-pagination
      @current-change="handleCurrentChange"
      background
      :current-page="1"
      :page-size="12"
      prev-text="上一页"
      next-text="下一页"
      layout="total, prev, pager, next, jumper"
      :total="user_list.total">
    </el-pagination>
</template>

<script>
import { mapGetters } from 'vuex';
import user from '@/api/user.js';

export default {
    name: 'personnel-table-pagination',
    computed: {
        ...mapGetters('personnel', ['user_list'])
    },
    methods: {
        handleCurrentChange(val) {
            user.getTableData({pageNumber: val}).then(res => {
                this.$store.commit('personnel/CHANGE_USER_LIST', res);
            })
        }
    }
}
</script>

<style>

</style>
